package t03;

/**
 * 销售员
 */
public class SalesEmployee extends Employee {
    private double sales;// 销售额
    private double commissionRate;// 提成比率

    public SalesEmployee(String name, int age, double sales, double commissionRate) {
        // 将销售额存入父类所提供的salary属性中
        super(name, age, sales);
        this.sales = sales;
        this.commissionRate = commissionRate;
    }

    @Override
    public double getSalary() {
        // 销售额的提成
        return super.getSalary() * commissionRate;
    }
}
